package top.blacknota.pojo;

import org.nutz.dao.entity.annotation.*;
import top.blacknota.utils.LpUtil;

import java.util.Date;

/**
 *
 * @author 撒哈拉来的企鹅
 * @date 2018-2-8
 */
public class User extends ClassLoader{

    @Name
    @Prev(els = @EL("uuid(32)"))
    private String id;//主键
//    @Column
    private String createId;//创建人ID
    @Column
    private Date createTime;//创建时间
    @Column
    private Date updateTime;//更新时间
    @Column
    private int enable;//有效标识
    @Column
    private String name;
    @Column
    private String username;
    @Column
    private String passhash;
    @Column
    private String dept;

    public String getName() {
        return name;
    }

    public void setPassword(String password) {
        this.passhash = LpUtil.hashpw(password);
    }

    public void setPasshash(String passhash) {
        this.passhash = passhash;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPasshash() {
        return passhash;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getDept() {
        return dept;
    }

    public void setDept(String dept) {
        this.dept = dept;
    }


    public String getId() {
        return id;
    }


    public void setId(String id) {
        this.id = id;
    }

    public String getCreateId() {
        return createId;
    }

    public void setCreateId(String createId) {
        this.createId = createId;
    }

    public Date getCreateTime() {
        return createTime;
    }


    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }


    public Date getUpdateTime() {
        return updateTime;
    }


    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }


    public int getEnable() {
        return enable;
    }


    public void setEnable(int enable) {
        this.enable = enable;
    }


    @Override
    public String toString() {
        return "User{" +
                "id='" + id + '\'' +
                ", createId='" + createId + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", enable=" + enable +
                ", name='" + name + '\'' +
                ", username='" + username + '\'' +
                ", passhash='" + passhash + '\'' +
                ", dept='" + dept + '\'' +
                '}';
    }

}
